Skip to content

Add per-cron-job reasoning-effort override (mirror of the model override)#181

Open
serxa wants to merge 1 commit into
mainfrom
serxa/per-cron-effort
Open

Add per-cron-job reasoning-effort override (mirror of the model override)#181
serxa wants to merge 1 commit into
mainfrom
serxa/per-cron-effort

Conversation

@serxa

@serxa serxa commented Jul 17, 2026

Copy link
Copy Markdown
Member

Problem

Cron/hook turns already run at the lower cron_effort (interactive sources keep the full agent.effort), and a cron job can already override its model in jobs.yaml. But cron_effort is a single global knob for all crons — trivial/mechanical jobs (health probes, pollers) and reasoning-heavy jobs (report drafting, triage) are forced to the same effort. You either keep it low (and the heavy jobs get starved) or high (and the cheap pollers burn tokens).

Fix

Add a per-job effort: field on CronJob, mirroring the existing model: override:

  • CronJob.effort (+ from_dict / save_jobs serialization).
  • CronService passes job.effort or None into run_cron / run_persistent_cron.
  • effort_override is threaded through run_run_inner_get_or_create_client, where it becomes effort=effort_override or self._base_effort_for_source(...) in the SessionSpec (also applied on the two client-retry paths so it survives a mid-turn reconnect).

Properties:

  • Opt-in / no behavior change — default "" falls back to the source-based cron_effort.
  • Still clamped — the override lands in spec.effort, which the backend runs through _effective_effort(spec.effort, model), so a per-job value is model-cap clamped like the default. Backend-agnostic (single SessionSpec construction point).

Testing

Added TestCronJobEffort (default, from_dict, and a save_jobsload_jobs round-trip). Full suite: 1551 passed, 2 skipped.

…ide)

Cron/hook turns run at the lower cron_effort while interactive sources keep the full effort, and a cron job can already override its model — but cron_effort is a single global knob, forcing trivial pollers and reasoning-heavy jobs to the same effort.

Add a per-job effort field on CronJob (mirroring model), threaded as effort_override through run -> _run_inner -> _get_or_create_client into SessionSpec.effort (incl. the client-retry paths). Default "" keeps the source-based cron_effort; the override still passes through _effective_effort model-cap clamping and is backend-agnostic. Opt-in, no behavior change.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant